import { defineStore } from 'pinia'

export interface MapState {
  token: string;
  user: Object
}


export const userStore = defineStore('userStore',{
	state:(): MapState=>{
		return {
			"token": '',
			"user": ''
		}
	},
	getters:{},
	actions:{
		setLogin(token: string,user: Object){
			this.token = token
			this.user = user
		},
		logout(){
			window.localStorage.clear()
		}
	},
	persist: true
})